home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000049_icon-group-sender_Wed Mar 7 08:13:17 2001.msg < prev    next >
Internet Message Format  |  2002-01-03  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27FDDo15367
  4.     for icon-group-addresses; Wed, 7 Mar 2001 08:13:13 -0700 (MST)
  5. Message-Id: <200103071513.f27FDDo15367@baskerville.CS.Arizona.EDU>
  6. From: "Wade Humeniuk" <humeniuw@cadvision.com>
  7. X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk
  8. Subject: Re: New Scientist Puzzle
  9. Date: Tue, 6 Mar 2001 18:29:08 -0700
  10. X-Trace: news3.cadvision.com 983932117 3919 207.148.137.216 (7 Mar 2001 02:28:37 GMT)
  11. X-Complaints-To: news@cadvision.com
  12. X-Priority: 3
  13. X-MSMail-Priority: Normal
  14. X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
  15. X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
  16. To: icon-group@cs.arizona.edu
  17. Errors-To: icon-group-errors@cs.arizona.edu
  18. Status: RO
  19. Content-Length: 3219
  20.  
  21. You missed Marc Battyani's solution.  The Lisp versions you included look a
  22. little verbose.
  23.  
  24. --------------->>>>>>
  25.  
  26. I should work, but couldn't resist...
  27. A Lisp version:
  28.  
  29. (let ((sqrs (loop for i from (ceiling (sqrt 1000)) upto (isqrt 9999)
  30.                collect (format nil "~d" (* i i))))
  31.       (vns '()))
  32.   (dolist (vier sqrs)
  33.     (dolist (neun sqrs)
  34.       (when (and (char= (aref neun 0)(aref neun 3))
  35.                  (char= (aref vier 2)(aref neun 1))
  36.                  (char/= (aref vier 0)(aref vier 1)(aref vier 2)
  37.                          (aref vier 3)(aref neun 0)(aref neun 2)))
  38.         (push (list vier neun) vns))))
  39.   (loop for (v n) in vns do
  40.     (if (= 1 (count v vns :key #'first)(count n vns :key #'second))
  41.       (format t "~%Found ~a ~a~%~%" v n))))
  42.  
  43. Found 6241 9409
  44.  
  45. Marc
  46.  
  47.  
  48.  
  49.  
  50.  
  51. "Steve Graham" <js.graham@home.com> wrote in message
  52. news:ERfp6.359416$ge4.127024410@news2.rdc2.tx.home.com...
  53. > Stefano,
  54. >
  55. >    I'm been quite pleased with the reception which this puzzle has
  56. received,
  57. > particularly in the APL newsgroup.  You can see a compilation of most of
  58. the
  59. > solutions at http://members.home.net/js.graham/vierneun.html
  60. >
  61. >    Best of luck.
  62. >
  63. >
  64. > Steve Graham
  65. >
  66. > P.S.  Would anyone be interested in another, slightly more complex
  67. puzzle???
  68. >
  69. > ===
  70. >
  71. > "Stefano Lanzavecchia" <lstefano@hotmail.com> wrote in message
  72. > news:9832qa$bbb$1@pegasus.tiscalinet.it...
  73. > > To all the peopl who have posted solutions.
  74. > > I am collecting them and will publish a few, in particular the APL and J
  75. > > ones but some written in other languages as well for comparison,
  76. hopefully
  77. > > not to feed a silly language flame war, on a small magazine of the
  78. British
  79. > > APL Association, for which I am now the editor.
  80. > > You can have a look at an online version of the magazine at this
  81. webpage:
  82. > > http://www.vector.org.uk/ where you can find sample of articles
  83. published
  84. > in
  85. > > the printed version. As you can see while a serious magazine, it's also
  86. > > reasonably informal, therefore there is no shame at all involved in
  87. having
  88. > > published code which could be thought as less than optimal. Instead,
  89. > there's
  90. > > a good chance that a version quickly hacked together would have some
  91. > > pedagogic and exemplar value because it shows what the language is
  92. capable
  93. > > of when put to the edges.
  94. > >
  95. > > Anyway, my question is: if the author of any of the solution appeared in
  96. > > these newsgroups (I have APL, J, K, MUMPS, Common Lisp, Dylan,
  97. Smalltalk,
  98. > > Perl, Python from which to choose from) strongly objects to have his
  99. > > solution published against his or her name, to please let me know and I
  100. > will
  101. > > remove the solution from my pool. Otherwise I'll work on the assumption
  102. > that
  103. > > by posting a message in a public newsgroups the author implicitely
  104. > indicated
  105. > > that, while not necessary proud, does not mind to see his work published
  106. > for
  107. > > public consumption.
  108. > >
  109. > > By the way, it's quite likely that the readers of Vector are less than
  110. the
  111. > > sums of the readers of these newgroups...
  112. > >
  113. > > Thank you everybody, and I hope you shared my fun in the solution of the
  114. > > little puzzle and in the comparison of the different languages.
  115. > > --
  116. > >     WildHeart'2k1 (at home)
  117. > >
  118. > >
  119. >
  120. >
  121.  
  122.  
  123.